#ifndef __USER_SERIAL_H
#define __USER_SERIAL_H

#include "main.h"
#include "cmsis_os.h"
#include "usart.h"
#include "gpio.h"

#include <stdio.h>

#define Debug_SERIAL huart1
#define Debug_SERIAL_DMA hdma_usart1_rx
#define RobotArm_SERIAL huart2
#define RobotArm_SERIAL_DMA hdma_usart2_rx
#define HIMI_SERIAL huart6
#define HIMI_SERIAL_DMA hdma_usart6_rx

void serial_init(void);

void serial_initDebug(void);
void serial_receiveDebug(UART_HandleTypeDef *huart, uint16_t Size);
uint8_t * serial_bufferDebug(void);
uint16_t serial_sizeDebug(void);

void serial_initRobotArm(void);
void serial_receiveRobotArm(UART_HandleTypeDef *huart, uint16_t Size);
uint8_t * serial_bufferRobotArm(void);
uint16_t serial_sizeRobotArm(void);

void serial_initHIMI(void);
void serial_receiveHIMI(UART_HandleTypeDef *huart, uint16_t Size);
uint8_t * serial_bufferHIMI(void);
uint16_t serial_sizeHIMI(void);

#endif
